Replace MessagingCenter in AlertManager#27888
Merged
Conversation
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
|
/rebase |
9b67592 to
518636c
Compare
Contributor
|
@jfversluis Could you rebase and fix the conflict? Thanks in advance. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes the deprecated MessagingCenter usage from the AlertManager and related components in favor of direct method calls, in line with the plan to decouple MessagingCenter from alert interactions. Key changes include:
- Removal of MessagingCenter subscription/unsubscription in tests and platform implementations.
- Replacement of MessagingCenter.Send calls in Page.cs with corresponding AlertManager Request calls.
- Adjustments in Window.cs and NavigationPage.cs to align with the new AlertManager APIs.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Controls/tests/Core.UnitTests/PageTests.cs | Removed MessagingCenter invocations and related tests. |
| src/Controls/tests/Core.UnitTests/AlertManagerTests.cs | Added unit tests validating the new AlertManager subscription behavior. |
| src/Controls/src/Core/Window/Window.cs | Moved SendWindowAppearing call to occur after handler assignment for better synchronization. |
| src/Controls/src/Core/Platform/AlertManager/*.cs | Updated platform-specific AlertManager implementations to use partial methods instead of MessagingCenter. |
| src/Controls/src/Core/Page/Page.cs | Replaced MessagingCenter.Send calls with AlertManager.Request* calls for alerts, action sheets, prompts, and busy notifications. |
| src/Controls/src/Core/NavigationPage/NavigationPage.cs | Reordered a child removal call to follow setting the current page. |
Comments suppressed due to low confidence (1)
src/Controls/src/Core/NavigationPage/NavigationPage.cs:787
- [nitpick] The reordering of removing the current page from inner children—now performed after setting the new current page—may impact page lifecycle or navigation behavior. Please verify that this change is intentional and consistent with expected navigation state transitions.
Owner.RemoveFromInnerChildren(currentPage);
rmarinho
approved these changes
Jun 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
This is #12910 but targeting .NET 10.
Since the
MessagingCenterwas obsolete and now marked internal, we would love to remove it! Now it is happening!!!This PR starts that process by removing usages of the
MessagingCenterin theAlertManager.Fixes #28857
Closes #12910